<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>ECharts</title>
    <!-- 引入 echarts.js -->
    <script src="echarts.min.js"></script>
</head>
<body >
<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
<div id="main" style="width: 220px;height:220px;"></div>
<script type="text/javascript">
        // 基于准备好的dom，初始化echarts实例

        var myChart = echarts.init(document.getElementById('main'));

        // 指定图表的配置项和数据
option = {
    series: [{
        type: 'gauge',
        startAngle: 180,
        endAngle: 0,
        min: 0,
        max: 1,
        splitNumber: 4,
        axisLine: {
            lineStyle: {
                width: 4,
                color: [
                    [0.25, '#FF6E76'],
                    [0.5, '#FDDD60'],
                    [0.75, '#58D9F9'],
                    [1, '#7CFFB2']
                ]
            }
        },
        pointer: {
            icon: 'path://M12.8,0.7l12,40.1H0.7L12.8,0.7z',
            length: '12%',
            width: 10,
            offsetCenter: [0, '-60%'],
            itemStyle: {
                color: 'auto'
            }
        },
        axisTick: {
            length: 5,
            lineStyle: {
                color: 'auto',
                width: 2
            }
        },
        splitLine: {
            length: 20,
            lineStyle: {
                color: 'auto',
                width: 5
            }
        },
        axisLabel: {
            color: '#464646',
            fontSize: 10,
            distance: -60,
            formatter: function (value) {

            }
        },
        title: {
            offsetCenter: [0, '-20%'],
            fontSize: 15
        },
        detail: {
            fontSize: 20,
            offsetCenter: [0, '0%'],
            valueAnimation: true,
            formatter: function (value) {
                return Math.round(value*100) + '%';
            },
            color: 'auto'
        },
        data: [{
            value: 0.70,
            name: 'bright'
        }]
    }]
};

function returnResult(result){

    option.series[0].data[0].value = result;

    myChart.setOption(option);


}
        myChart.setOption(option);
    </script>
</body>
</html>